﻿using System;
using System.Linq;
using Ficharts.Net.Examples.Code;

namespace Ficharts.Net.Examples.Examples.Multiple
{
    public partial class ColumnLine : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var chart = this.Chart;
                chart.ChartTitle.Title = "产品销量状况";
                chart.XAxises.Add(new FieldAxis { Title = "年份" });
                chart.YAxises.Add(new LinearAxis { Title = "销量" });

                chart.Series.Add(new Line { SeriesName = "产品A", XField = "Year", YField = "ValueA", SingleColor = true, LabelDisplay = LabelDisplayMode.none });
                chart.Series.Add(new Column { SeriesName = "产品B", XField = "Year", YField = "ValueB", SingleColor = true, LabelDisplay = LabelDisplayMode.inner });
                chart.Legend.Enable = true;
                var demo = new Demo();
                chart.DataSource = (from c in demo.sample
                                    select c).ToList();
                chart.DataBind();
            }
        }
    }
}